<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    </head>
    <body>
        <?php
        require 'connect.inc';
        require 'session.inc';
        $result;
        $res = "";
        $res .=
                "<table width='100%' border='1' cellspacing='0'>
            <tbody>
                <tr></tr>
                <tr>
                    <td>
                        <img src='logo.jpg'>
                    </td>
                    <td>
                        <h1>Photo Album Website</h1>
                    </td>
                </tr>
                <tr>
                    <td width='20%' valign='top'>
                        <a href='index.php'>Home</a>
                        <br>
                        <a href='my_albums.php'>My Albums</a>
                        <br>
                        <a href='users.php'>Other persons</a>
                    </td>";

        $res .= " <td>Others users:
                        
                     <br><br>";
        $strSQL = "SELECT * FROM users";
        $result = mysql_query($strSQL);
        if ($result) {
            while ($row = mysql_fetch_array($result)) {
                $iduser = $row["user_id"];
                $avatar = $row["avatar"];
                $name = $row["full_name"];
                $res .= "<table style='float:left;'>
                        <tbody>
                            <tr>
                                <td>
                                    <img height='100' src='./upload/$iduser/avatar/$avatar'>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <a href='view_user.php?user_id=$iduser'>$name</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>";
            }
        }
        $res .= " <td width='20%' valign='top'>";
        // User logged in
        if ($_SESSION["isLogin"] == 1) {
            $res .= "Wellcom <a href='#'>" . $_SESSION["username"] . "</a>!
                |
                <a href='logout.php'>Logout</a>";
        } else {
            $res .= "<a href='login.php'>Login</a>
                    <a href='register.php'>Register</a>
                </td>";
        }
        $res.="</td>
        </tr>
    </tbody>
    </table>";
        echo $res;
        ?>
    </body>


</html>
